import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 强仔
 * Date: 2022-05-22
 * Time: 17:43
 */
public class Main {
    /*
    * 找出最长的数字串
    * https://www.nowcoder.com/practice/bd891093881d4ddf9e56e7cc8416562d?tpId=85&&tqId=29864&rp=1&ru=/activity/oj&qru=/ta/2017test/question-ranking
    * 暴力搜就行
    * */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();

        // 计数器
        int count = 0;
        // 最长的数字串的长度
        int result = 0;
        // 最长数字串 最后一个字符的 下标
        int end = -1;

        int i = 0;
        for (; i < s.length(); i++) {
            char ch = s.charAt(i);
            if('1' <= ch && ch <= '9') {
                count++;
            }else {
                end = count > result ? i - 1 : end;
                result = Math.max(result, count);
                count = 0;
            }
        }
        end = count > result ? i - 1 : end;
        result = Math.max(result, count);

        String string = s.substring(end - result + 1, end + 1);

        System.out.println(string);
    }

    /*
    * 数组中出现次数超过数组长度一半的数字
    * HashMap
    * */
    public int MoreThanHalfNum_Solution(int [] array) {
        int mid = array.length / 2;
        HashMap<Integer, Integer> map = new HashMap();
        for (int elem : array) {
            map.put(elem, map.getOrDefault(elem, 0) + 1);
        }

        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            if(entry.getValue() > mid){
                return entry.getKey();
            }
        }
        return -1;
    }
}
